package com.brillilab.starter.controller.elsearch;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.brillilab.domain.pa.kit.SampleSearchPa;
import com.brillilab.domain.po.elsearch.EsSample;
import com.brillilab.service.core.elsearch.IEsSampleService;
import com.brillilab.starter.aspect.AspectLog;

@RestController
@RequestMapping("/es/sample")
public class EsSampleCotroller {

    @Autowired
    private IEsSampleService esSampleService;

    
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public EsSample querySampleById(@RequestParam Long kitId) {
    	return esSampleService.queryById(kitId);
    }
    
    @AspectLog
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public EsSample querySampleById(@RequestBody EsSample eb) {
    	return esSampleService.save(eb);
    }
    
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public Page<EsSample> querySampleById(@RequestBody SampleSearchPa pa) {
    	return esSampleService.queryList(pa);
    }
}
